<?php 
if($ad->getImage())
{
	$style = 'overflow:hidden;';
	switch($adc->getViewObject())
	{
		case 'AdLatest':
			//$style .= 'width:'.$adc->getSetting('ImageLatestW').'px; height:'.$adc->getSetting('ImageLatestH').'px;';
			//case 'AdEdit':
			?>
			<a style="<?php echo $style; ?>" href="<?php echo $ad->getLink(); ?>">
				<?php if($ad->getImageId() > 0): ?>
					<img title="<?php echo $ad->getTitle(); ?>" alt="<?php echo $ad->getTitle().' '.$txt->getWord('image'); ?>" src="<?php echo $ad->getImage()->getLink($adc->getSetting('ImageLatestW'), $adc->getSetting('ImageLatestH')); ?>" />
				<?php else: ?>
					<img title="<?php echo $ad->getTitle(); ?>" alt="<?php echo $ad->getTitle().' '.$txt->getWord('image'); ?>" src="<?php echo $adc->getAdType($ad->getTypeId())->getImageURL($adc->getSetting('ImageLatestW'), $adc->getSetting('ImageLatestH')); ?>" />
				<?php endif; ?>
			<?php
			break;
		case 'AdGallery':
			//$style .= 'width:'.$adc->getSetting('ImageGalleryW').'px; '; // height:'.$adc->getSetting('ImageGalleryH').'px;';
			?>
			<a class="center" style="<?php echo $style; ?>" href="<?php echo $ad->getLink(); ?>">
				<?php if($ad->getImageId() > 0): ?>
				<img title="<?php echo $ad->getTitle(); ?>" alt="<?php echo $ad->getTitle().' '.$txt->getWord('image'); ?>" src="<?php echo $ad->getImage()->getLink($adc->getSetting('ImageGalleryW'), $adc->getSetting('ImageGalleryH')); ?>" />
				<?php else: ?>
				<img title="<?php echo $ad->getTitle(); ?>" alt="<?php echo $ad->getTitle().' '.$txt->getWord('image'); ?>" src="<?php echo $adc->getAdType($ad->getTypeId())->getImageURL($adc->getSetting('ImageGalleryW'), $adc->getSetting('ImageGalleryH')); ?>" />
				<?php endif; ?>
			<?php
		break;
		default:
			//$style .= 'width:'.$adc->getSetting('ImageListW').'px; height:'.$adc->getSetting('ImageListH').'px;';
			?>
			<a style=" <?php echo $style; ?> " href="<?php echo $ad->getLink(); ?>">
				<?php if($ad->getImageId() > 0): ?>
				<img title="<?php echo $ad->getTitle(); ?>" alt="<?php echo $ad->getTitle().' '.$txt->getWord('image'); ?>" src="<?php echo $ad->getImage()->getLink($adc->getSetting('ImageListW'), $adc->getSetting('ImageListH')); ?>" />
				<?php else: ?>
				<img title="<?php echo $ad->getTitle(); ?>" alt="<?php echo $ad->getTitle().' '.$txt->getWord('image'); ?>" src="<?php echo $adc->getAdType($ad->getTypeId())->getImageURL($adc->getSetting('ImageListW'), $adc->getSetting('ImageListH')); ?>" />
				<?php endif; ?>
			<?php
		break;
	}
	if($ad->getIsCompleted() > 0)
	{ ?>
		<div class="sold pull-left" style="position:relative; left:10px; bottom:30px;">
		<p class="float-left"><?php echo ucfirst($ad->getIsBoughtText()); ?>&nbsp;&nbsp;</p>
		<img src="<?php echo SYSICONS_URL ?>ok_16.png" width="16" height="16" alt="<?php echo ucfirst($ad->getIsBoughtText()); ?>" title="<?php echo ucfirst($ad->getIsBoughtText()); ?>" />
		</div>
		<?php
	}
	if($ad->getIsBuying() > 0)
	{ ?>
		<div class="sold pull-left" style="position:relative; left:10px; bottom:30px;">
		<p class="float-left">&nbsp;&nbsp;<?php echo ucfirst($ad->getIsBuyingText()); ?>&nbsp;&nbsp;</p>
		<img src="<?php echo SYSICONS_URL ?>star_16.png" width="16" height="16" alt="<?php echo ucfirst($ad->getIsBuyingText()); ?>" title="<?php echo ucfirst($ad->getIsBuyingText()); ?>" />
		</div>
		<?php
	}
	echo '</a>';
} 
?>